<template>
  <view class="app-container">
    <view class="modules-container">
      <!-- 模块1 -->
      <view class="module-item" @click="navigateToModule('/pages/video/video')">
        <view class="module-icon">
          <image src="/static/icons/module1.svg" mode="aspectFit"></image>
        </view>
        <text class="module-name">视频</text>
        <text class="module-desc">探索精彩内容</text>
      </view>
      
      <!-- 模块2 -->
      <view class="module-item" @click="navigateToModule('/pages/img/img')">
        <view class="module-icon">
          <image src="/static/icons/module2.svg" mode="aspectFit"></image>
        </view>
        <text class="module-name">图片</text>
        <text class="module-desc">查看图片列表</text>
      </view>
      
      <!-- 模块3 -->
      <view class="module-item" @click="navigateToModule('/pages/module3/module3')">
        <view class="module-icon">
          <image src="/static/icons/module3.svg" mode="aspectFit"></image>
        </view>
        <text class="module-name">游戏中心</text>
        <text class="module-desc">热门游戏</text>
      </view>
      
      <!-- 模块4 -->
      <view class="module-item" @click="navigateToModule('/pages/module4/module4')">
        <view class="module-icon">
          <image src="/static/icons/module4.svg" mode="aspectFit"></image>
        </view>
        <text class="module-name">模块4</text>
        <text class="module-desc">我的收藏</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      // 可以在这里添加需要的数据
    }
  },
  onLoad() {
    // 页面加载时的逻辑
  },
  methods: {
    navigateToModule(url) {
      uni.navigateTo({
        url: url
      })
    }
  }
}
</script>

<style scoped>
.app-container {
  padding: 20rpx;
  background-image: url('/static/backgrounds/app-bg.svg');
  background-size: cover;
  background-position: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 60rpx 0 30rpx;
  text-align: center;
}

.app-title {
  font-size: 48rpx;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.2);
}

.modules-container {
  columns: 2;
  column-gap: 50rpx;
  padding: 100rpx;
  flex: 1;
}

.module-item {
  break-inside: avoid;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20rpx;
  padding: 40rpx 20rpx;
  margin-bottom: 20rpx;
  text-align: center;
  box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  backdrop-filter: blur(10rpx);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.module-item:active {
  transform: scale(0.96);
  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
}

.module-item:nth-child(1) .module-icon {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.module-item:nth-child(2) .module-icon {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.module-item:nth-child(3) .module-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.module-item:nth-child(4) .module-icon {
  background: linear-gradient(135deg, #00dbde 0%, #fc00ff 100%);
}

.module-icon {
  width: 140rpx;
  height: 140rpx;
  margin: 0 auto 30rpx;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.module-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
  transform: rotate(45deg);
  animation: shine 2s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.module-icon image {
  width: 80rpx;
  height: 80rpx;
  filter: drop-shadow(0 2rpx 4rpx rgba(0, 0, 0, 0.1));
  z-index: 1;
}

.module-name {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 10rpx;
  display: block;
  position: relative;
  padding-bottom: 10rpx;
}

.module-name::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40rpx;
  height: 4rpx;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2rpx;
}

.module-desc {
  font-size: 26rpx;
  color: #666;
  line-height: 36rpx;
  padding: 0 10rpx;
}
</style>